
inline static void LCDcharDef(uint8_t n,uint8_t row8 ,uint8_t row7 ,uint8_t row6,uint8_t row5,uint8_t row4,uint8_t row3,uint8_t row2, uint8_t row1)
{
	uint8_t i,m=(n-1)*8;

	lcd_command(_BV(LCD_CGRAM));

	for(i=0;i<m;i++)
	{
		lcd_waitbusy();
		lcd_read(1);
	}
	lcd_data(row8);
	lcd_data(row7);
	lcd_data(row6);
	lcd_data(row5);
	lcd_data(row4);
	lcd_data(row3);
	lcd_data(row2);
	lcd_data(row1);
}

inline static void LCDbargraphV(long int yv, long int ymin, long int ymax, long int posx)
{
	long int y;

	y = yv - ymin;
	y = y * 160;
	y = (y / (ymax - ymin) + 5) / 10;

	if(y>8) 
	{
		LCD_XY(posx,1) LCD_CHAR(y-8-1)
		LCD_XY(posx,2) LCD_CHAR(8-1)
	}
	else if(y>0)
	{
		LCD_XY(posx,1) LCD_CHAR(' ')
		LCD_XY(posx,2) LCD_CHAR(y-1)
	}
	else
	{
		LCD_XY(posx,1) LCD_CHAR(' ')
		LCD_XY(posx,2) LCD_CHAR(' ')
		}
}
